package com.ruoyi.game.mapper;

import java.util.List;

import com.ruoyi.game.domain.GameRoom;

/**
 * 房间Mapper接口
 * 
 * @author ruoyi
 * @date 2025-04-18
 */
public interface GameRoomMapper 
{
    /**
     * 查询房间
     * 
     * @param id 房间主键
     * @return 房间
     */
    public GameRoom selectGameRoomById(Long id);

    /**
     * 查询房间列表
     * 
     * @param gameRoom 房间
     * @return 房间集合
     */
    public List<GameRoom> selectGameRoomList(GameRoom gameRoom);

    /**
     * 新增房间
     * 
     * @param gameRoom 房间
     * @return 结果
     */
    public int insertGameRoom(GameRoom gameRoom);

    /**
     * 修改房间
     * 
     * @param gameRoom 房间
     * @return 结果
     */
    public int updateGameRoom(GameRoom gameRoom);

    /**
     * 删除房间
     * 
     * @param id 房间主键
     * @return 结果
     */
    public int deleteGameRoomById(Long id);

    /**
     * 查询所有房间（用于系统启动清理）
     */
    List<GameRoom> selectAllRooms();

    /**
     * 批量删除房间
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteGameRoomByIds(Long[] ids);

    public int countByRoomCode(String roomCode);

    public GameRoom selectByRoomCode(String roomCode);
    public int deleteExpiredWaitingRooms();
    /**
     * 根据房间号查询房间
     */
    GameRoom selectGameRoomByCode(String roomCode);
}
